<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // var box1 = new RegExp("hello","gi")
        // console.log(box1)


        // var str = "how are you"
        // var box3 = /are/gi
        // console.log(box3.test(str))

        // var str1 = "how aRe you"
        // var box5 = /are/g
        // var box4 = /are/gi
        // console.log(box5.exec(str1))//匹配不到返回NULL
        // console.log(box4.exec(str1))//匹配成功返回数组

        // var box = /are/ig//后面加i为忽略大小写，后面加g为全局
        // var str = 'how are Are ARE you'
        // console.log(str.match(box))//返回同样是数组
        
        // var str1 = 'how are Are ARE you'
        // var newStr = str1.replace(/are/ig,"*")
        // console.log(newStr)

        // var str1 = 'how are Are ARE you'
        // var newStr = str1.split(/are/ig)
        // console.log(newStr)

        // var str1 = 'how are Are ARE you'
        // console.log(str1.search(/are/ig))//传回的是第一次出现的位置
    </script>
</head>
<body>
    
</body>
</html>